package com.sicpa.web.controller.common;

import com.sicpa.common.constant.Constants;
import com.sicpa.common.core.domain.AjaxResult;
import com.sicpa.common.core.redis.RedisCache;
import com.sicpa.common.utils.RandomNumCode;
import com.sicpa.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.concurrent.TimeUnit;

/**
 * CaRandomCodeGenerateController
 * @author lwf
 */
@RestController
@RequestMapping("/ca")
public class CaController {

    private RedisCache redisCache;

    @Autowired
    public CaController(RedisCache redisCache) {
        this.redisCache = redisCache;
    }

    /**
     * ca获取16位随机码
     * @return
     */
    @GetMapping("/randomCode")
    public AjaxResult getCaRandomCode(){
        String caRandomCode = RandomNumCode.getGUID();
        AjaxResult ajaxResult = AjaxResult.success();
        ajaxResult.put("caRandomCode",caRandomCode);
        return ajaxResult;
    }

}
